<!--#include file="lib/utf-8.asp"-->
<!--#include file="lib/connopen.asp"-->
<!--#include file="lib/asp-common-lib.asp"-->
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>报关单登记系统</title>
<style type="text/css">
  .base{
    padding:8px;
  }
  .baseCenter{
    left:50%;
    margin-left:-10.5cm;
    width:21.3cm;
    position:relative;
  }
  .baseBlock{
    left:50%;
    margin-left:-10.5cm;
      width:21cm;
      position:relative;
  }
  .baseBlockIn{
      padding:0.5cm 0.2cm;
      background:#fff;
      box-shadow:0 0 8px #000;
      -moz-box-shadow:0 0 8px #000;
      -webkit-box-shadow:0 0 8px #000;
      position:relative;
      z-index:1;
  }
</style>
<!--[if IE]>
<style type="text/css">
  .baseBlockIn{
    top:8px;
    left:8px;
  }
  .ieShadow{
    filter:progid:DXImageTransform.Microsoft.Blur(pixelradius=8);
    -ms-filter:"progid:DXImageTransform.Microsoft.Blur(pixelradius=8)";
    background-color:#000;
    position:relative;
  }
</style>
<![endif]-->
<!--#include file="lib/js-google-analytics.asp"-->
</head>
<body>
<div class="cdframe">
<%
id=saferequest("id",1)
rcd=saferequest("rcd",0)
if rcd<>"null" then 
    if not CheckFlag(session("aaPostFlag"),2) then call JumpErrorPage(2)
end if
set rs=Server.CreateObject("ADODB.Recordset")
sql="select cd_no from cd where id="&id
if rcd<>"null" then
    if CheckWtr() then sql=sql&" and wtr="&session("iWtr")
end if
' response.write(sql)
rs.open sql,conn,1,1
if not rs.eof then
    if rcd="null" then
        call SimpleRecord("file",id,"查看","成功","null",OperateClient("null"),false)
    elseif rcd<>"no" then
        call SimpleRecord("file",id,"查看","成功",session("iId"),session("iClientId"),false)
    end if
    call ShowFile(rs("cd_no"))
else
    if rcd="null" then
        call SimpleRecord("file",id,"查看","失败","null",OperateClient("null"),false)
    elseif rcd<>"no" then
        call SimpleRecord("file",id,"查看","失败",session("iId"),session("iClientId"),false)
    end if
    call JumpErrorPage(2)
end if
rs.close
set rs=nothing

function ShowFile(cd_no)
  dim sign,fs,cd_file
  sign=1
  Set fs=Server.CreateObject("Scripting.FileSystemObject")
  cd_file=Server.MapPath(".")&"\file\html\"&cd_no&"."&sign&".html"
  ' cd_box=Server.MapPath(".")&"\file\"&cd_no&".box.html"
  ' Response.Write(cd_file)
  If Not fs.FileExists(cd_file) then
    Response.Write("原始报关单未保存在系统中")
  else
      Response.Write("<div class='base'><div class='baseCenter'><a href='pdffile.asp?id="&id&"&rcd="&rcd&"'>转到PDF版</a>&nbsp;&nbsp;&nbsp;<a href='file/pdf/"&cd_no&".pdf'>下载完整PDF文件</a></div></div>")
      Do While fs.FileExists(cd_file)
        Response.Write("<div class='base'><div class='baseBlock'><div class='ieShadow'><div class='baseBlockIn'><iframe frameborder='0' scrolling='auto' width='100%' height='1123' src='file/html/"&cd_no&"."&sign&".html"&"'></iframe></div></div></div></div>")
        sign=sign+1
        cd_file=Server.MapPath(".")&"\file\html\"&cd_no&"."&sign&".html"
      Loop
      ' If fs.FileExists(cd_box) then Response.Write("<div class='base'><div class='baseBlock'><div class='ieShadow'><div class='baseBlockIn'><iframe frameborder='0' scrolling='auto' width='100%' height='1123' src='file/"&cd_no&".box.html"&"'></iframe></div></div></div></div>")
  end if
  set fs=nothing
end function
%>
</div>
</body>
</html>
<!--#include file="lib/connclose.asp"-->

